import { createApp } from 'vue';
import App           from './App.vue';
import router        from './router';
import store         from './store';
import { ELComponents, ELPlugins } from './lib/element';
import { AntdComponent, AntdProvide } from './lib/antd';
import request       from './utils/request';
// import 'element-plus/lib/theme-chalk/index.css';
// import 'ant-design-vue/dist/antd.css';

const app = createApp(App);
// 按需导入Element Plus组件和插件
ELComponents.forEach(component => {
  app.component(component.name, component)
});
ELPlugins.forEach(plugin => {
  app.use(plugin)
});
// 按需导入 Ant Design组件和全局组件方法
AntdComponent.forEach(component => {
  app.use(component)
});
AntdProvide.forEach(item => {
  app.provide(item[0], item[1]);
});
app.provide('$request', request);
app.use(store);
app.use(router);
app.mount('#app');
